from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.get("https://cart.taobao.com/cart.htm?spm=a21bo.jianhua.1997525049.1.5af911d92dthX5&from=mini&pm_id=1501036000a02c5c3739")

# 显示等待
search = WebDriverWait(driver,10,0.5).until(EC.presence_of_element_located((By.XPATH,"/html/body/div[1]/div[2]/div[2]/div/div[2]/div[1]/div/div[1]/div/div/label")))
search.click()

time.sleep(3)
pay = WebDriverWait(driver,10,0.5).until(EC.presence_of_element_located((By.XPATH,"/html/body/div[1]/div[2]/div[2]/div/div[3]/div/div[2]/div[3]/div[5]/a")))
pay.click()
time.sleep(5)

jiesuan = driver.find_element(by=By.XPATH,value='//*[@id="submitOrderPC_1"]/div/a[2]')
jiesuan.click()

time.sleep(6)

psw = driver.find_element(by=By.XPATH,value='/html/body/div[2]/div[2]/form/div[2]/div[2]/div/div/span[2]/input')
psw.send_keys("123456")




